close all;

reg = 5;

% figure;
% hold on;
% method = 4;
% if(isempty(out{method,reg}) == 0)
%     plot(out{method,reg}.Time, out{method,reg}.RMSE, 'linewidth', 2);
% end
% method = 5;
% if(isempty(out{method,reg}) == 0)
%     plot(out{method,reg}.Time, out{method,reg}.RMSE, 'linewidth', 2);
% end
% method = 3;
% if(isempty(out{method,reg}) == 0)
%     plot(out{method,reg}.Time, out{method,reg}.RMSE, 'linewidth', 2);
% end
% method = 1;
% plot(out{method,reg}.Time, out{method,reg}.RMSE, 'linewidth', 2);
% method = 2;
% plot(out{method,reg}.Time, out{method,reg}.RMSE, 'linewidth', 2);
% 
% axis([0, 300, 0.78, 0.95]);
% xlabel('time(second)');
% ylabel('testing RMSE');
% legend('IRNN', 'GIST', 'GIST(threshold)', 'NOCOL(standard)', 'NOCOL(fast)');
% box on;
% % legend('GIST', 'NOCOL', 'fastNOCOL');

%% ---------------------------------------------------------------
figure;
best = min([min(out{1,reg}.obj), min(out{2,reg}.obj), min(out{3,reg}.obj),min(out{4,reg}.obj),min(out{5,reg}.obj)]) - 300;

method = 4;
if(isempty(out{method,reg}) == 0)
    % temp = out{method,reg}.obj - min(out{method,reg}.obj) + 1;
    temp = (out{method,reg}.obj - best)/best;
    plot(out{method,reg}.Time, temp, 'linewidth', 2);
    hold on;
end
method = 5;
if(isempty(out{method,reg}) == 0)
    % temp = out{method,reg}.obj - min(out{method,reg}.obj) + 1;
    temp = (out{method,reg}.obj - best)/best;
    plot(out{method,reg}.Time, temp, 'linewidth', 2);
    hold on;
end
% method = 3;
% if(isempty(out{method,reg}) == 0)
%     % temp = out{method,reg}.obj - min(out{method,reg}.obj) + 1;
%     temp = (out{method,reg}.obj - best)/best;
%     plot(out{method,reg}.Time, temp, 'linewidth', 2);
%     hold on;
% end
% method = 1;
% % temp = out{method,reg}.obj - min(out{method,reg}.obj) + 1;
% temp = (out{method,reg}.obj - best)/best;
% plot(out{method,reg}.Time, temp, 'linewidth', 2);
% hold on;

method = 2;
% temp = out{method,reg}.obj - min(out{method,reg}.obj) + 1;
temp = (out{method,reg}.obj - best)/best;
plot(out{method,reg}.Time, temp, 'linewidth', 2);

% axis([0, 500, 1, 100000]);
xlabel('time(second)');
ylabel('(objective - best)/best');
legend('IRNN', 'GPG', 'FaNCL');
% legend('GIST', 'NOCOL', 'fastNOCOL');
box on;
